<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <body>

        <ui:composition template="./../Template.xhtml">

            

            <ui:define name="content">
                <h:form id="formRelAll">
                    <p:panelGrid columns="2">
                        <f:facet name="header">
                            Relatório Geral Mensal
                        </f:facet>
                        <h:outputText value="Informe o mês.:*"/>
                        <p:selectOneMenu  value="#{relatMensalFaces.selectedRelatMensal.mes}">
                            <f:selectItems value="#{relatMensalFaces.meses}"/>
                        </p:selectOneMenu>
                        
                    </p:panelGrid>
                    <br/>
                    <p:commandButton action="#{relatMensalFaces.findAllEscolaPorMes()}" ajax="false" value="Gerar"/>
                    <br/>
                    <p:dataTable  var="relat" value="#{relatMensalFaces.relatorios}" id="relAllMensal" resizableColumns="true" >
                        <f:facet name="header">
                            Edição dos Relatórios
                        </f:facet>
                       

                         <p:column headerText="Escola" style="width:50%;text-align: center" >
                            <p:cellEditor>
                                <f:facet name="output">
                                    <h:outputText value="#{relat.escola.escola}" />
                                </f:facet>
                                <f:facet name="input">
                                   
                                    <h:outputText value="#{relat.escola.escola}"/>
                                </f:facet>
                            </p:cellEditor>

                        </p:column>
                        <p:column headerText="Professor" style="width:40%;text-align: center">
                            <p:cellEditor>
                                <f:facet name="output">
                                    <h:outputText value="#{relat.professor.nome}" />
                                </f:facet>
                                <f:facet name="input">
                                   
                                    <h:outputText value="#{relat.professor.nome}"/>
                                </f:facet>
                            </p:cellEditor>
                            
                        </p:column>
                        <p:column headerText="Núm. do LEI" style="width:15%;text-align: center">
                             <p:cellEditor>
                                <f:facet name="output">
                                    <h:outputText value="#{relat.lei.num_lei}" />
                                </f:facet>
                                <f:facet name="input">
                                   
                                    <h:outputText value="#{relat.lei.num_lei}"/>
                                </f:facet>
                            </p:cellEditor>
                        </p:column>
                           <p:column headerText="Total de Micros" style="width:20%;text-align: center">
                             <p:cellEditor>
                                <f:facet name="output">
                                    <h:outputText value="#{relat.lei.qtde_pc}" />
                                </f:facet>
                                <f:facet name="input">
                                   
                                    <h:outputText value="#{relat.lei.qtde_pc}"/>
                                </f:facet>
                            </p:cellEditor>
                        </p:column>
                        <p:column headerText="Micros Danif." style="width:20%;text-align: center">
                             <p:cellEditor>
                                <f:facet name="output">
                                    <h:outputText value="#{relat.microsDefeito}" />
                                </f:facet>
                                <f:facet name="input">
                                   
                                    <h:outputText value="#{relat.microsDefeito}"/>
                                </f:facet>
                            </p:cellEditor>
                        </p:column>
                       
                        <p:column style="width:30%;text-align: center" headerText="Editar - Apagar">
                           
                            <p:commandButton  action="#{relatMensalFaces.starEdit()}"  ajax="false"  icon="ui-icon-pencil" alt="Editar Informações" label="Editar">
                                <f:setPropertyActionListener target="#{relatMensalFaces.selectedRelatMensal}" value="#{relat}"/>
                            </p:commandButton>
                            <p:commandButton   action="#{relatMensalFaces.del()}"  ajax="false" update="formRelAll:relAllMensal" icon="ui-icon-trash" alt="Apagar Informações" label="Apagar">
                                <f:setPropertyActionListener target="#{relatMensalFaces.selectedRelatMensal}" value="#{relat}"/>
                            </p:commandButton>
                        </p:column>
                    </p:dataTable>
                    
                </h:form>
            </ui:define>

            

        </ui:composition>

    </body>
</html>
